home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 007 / d86.arc / COMMANDS.DOC < prev    next >
Text File  |  1986-08-29  |  6KB  |  119 lines

  1. ---COMMANDS.DOC---
  2.  
  3. Debugger Command Language
  4.  
  5. In addition to immediate-execution assembly-language commands, there is a
  6. set of commands recognized by the debugger.  They are identified by the first
  7. keyword on the line being a single letter (i.e., the second character of the
  8. line is a non-letter, usually a comma or ENTER).
  9.  
  10.  
  11. General Operands to Debugger Commands
  12.  
  13. Most of the debugger commands consist of their single-letter identifier,
  14. followed by a comma, followed by one or more general operands, separated by
  15. commas.  General operands can be one of the following:
  16.  
  17.    a. a numeric constant, whose format is just as in the assembly language
  18.       (leading zero means default hex, otherwise default decimal)
  19.    b. a register name
  20.    c. a user-symbol from the assembly-language program being debugged.
  21.  
  22.  
  23. Format of Debugger Command Examples
  24.  
  25. Many of the examples given below will be given in double-quotes.  Note that
  26. the double-quotes are not part of the command.  You are encouraged to try
  27. out the example on the debugger, by typing the string within the quotes, not
  28. including the quotes, and always followed by the ENTER key. Note further that
  29. the double-quoted string may be broken across two lines of this manual, but
  30. that does not mean you should type a ENTER where the string is broken--
  31. debugger commands always consist of a single line, always terminated by ENTER.
  32.  
  33.  
  34. The Debugger Command Set
  35.  
  36. Following is a description of the debugger commands recognized:
  37.  
  38. B  sets and clears the fixed breakpoints of the program.  The debugger has four
  39.    breakpoints.  Two are transitory; they are automatically cleared after each
  40.    return from the program to the debugger.  They can be set by the G command.
  41.    The other two are fixed-- they will remain in effect until you explicitly
  42.    clear them.  The fixed breakpoints are controlled by this B command.
  43.  
  44.    You follow the B with zero, one, or two general operands.  If there are zero
  45.    operands (the B is followed immediately by a ENTER), then both fixed
  46.    breakpoints are cleared.  If there are one or two operands, then the fixed
  47.    breakpoints are set to the operands.
  48.  
  49.    Note that previously-set breakpoints can be implicitly cleared, by
  50.    overwriting them with other breakpoints.  If your B command has one operand,
  51.    and there was one breakpoint previously set, the debugger sets the unused
  52.    breakpoint, so that both remain in effect.  If your B command has one
  53.    operand, and both breakpoints were previously set, the most recently-set
  54.    breakpoint is saved, and the older breakpoint is overwritten.
  55.  
  56.    Examples: if you type "b,numout", the debugger will set a breakpoint at
  57.    location NUMOUT, which should be a label in the program being debugged.
  58.    You may start and stop the program many times, the the breakpoint will
  59.    stay there.  You may even allow the program to stop at NUMOUT repeatedly;
  60.    the breakpoint is not cleared even if the program stops there.  If you
  61.    subsequently type the command "b,01000", then there will be breakpoints
  62.    at both NUMOUT and location hex 01000.  If you then type "b,01200", the
  63.    first breakpoint NUMOUT is overwritten; the two breakpoints now in effect
  64.    are 01000 and 01200.  The 01000 breakpoint will be next in line to be
  65.    overwritten.  You may clear both breakpoints by typing "b".  There is no
  66.    way to clear one breakpoint at a time.
  67.  
  68.  
  69. G  starts the user program.  If there are no operands, then G is equivalent to
  70.    the ctrl-G command.  You can give one or two operands to G, specifying
  71.    locations within the program at which you wish to return to the debugger.
  72.    These are "transitory breakpoints"; they are cleared when the program
  73.    returns to the debugger for any reason.
  74.  
  75.    Whenever you start the program, at least one instruction from the program
  76.    will be executed, even if there is a breakpoint at the current instruction
  77.    pointer location.  This means you can set a breakpoint at the current
  78.    location; instructing the program to return to the debugger the next time
  79.    it gets back to the current location.
  80.  
  81.  
  82. J  jumps to the location indicated by the operand, within the current code
  83.    segment.  J is useful when you are exploring memory outside of your
  84.    program's memory area.  In that case, the immediate JMP command is executed
  85.    from a buffer within your program's original code segment.  JMP would
  86.    therefore return you to that segment. J will keep you in the distant
  87.    segment.
  88.  
  89.  
  90. O  sets a special fixed breakpoint.  Whenever your program calls MSDOS via
  91.    INT 33, the debugger will monitor the function number passed in the AH
  92.    register.  If the function number falls within the range specified by this
  93.    command, the program will trap back to the debugger.  If you give two
  94.    operands to O, the operands are the lower and upper bounds for the range
  95.    of trapped functions.  If you give one operand, only that function-number
  96.    will be trapped.  If you give no operands, any previous O-trap setting is
  97.    cleared.
  98.  
  99.    For example, note that function 3F hex is the READ function for MSDOS
  100.    version 2.  If you want to trap whenever this READ function is invoked,
  101.    you can issue the command O,03F and then start up your program with the G
  102.    command.  Another example: suppose you want to insure that a program does
  103.    not make any of the new Version 3 DOS calls, 59 hex and above.  You can
  104.    issue the command O,059,0FF and then start your program.
  105.  
  106.    NOTE: if the second operand is less than the first, then the range wraps
  107.    around through zero.  For example, O,059,030 traps on 059 through 0FF,
  108.    and also 0 through 030-- both version 3 and version 1 calls.
  109.  
  110.    SECOND NOTE: The EXIT function, hex 4C is always trapped by D86, regardless
  111.    of your O-command settings.  The only way you should be able to exit from D86
  112.    is via the Q-command.  (If you do succeed in exiting some other way, I want
  113.    to hear about it.  In that case, D86 will become very confused if you
  114.    reinvoke it before rebooting the computer.)
  115.  
  116.  
  117. Q  exits the debugger and goes back to the operating system.
  118.  
  119.